'use strict'

class attention{
    constructor (mdb) {
        this.db = mdb
        this.tableName = 'attention'
      }
    
    model () {
        return this.db.model(this.tableName)
    }

    async select(userid,attentionid){
        let ulist = await this.model().where({userid,attentionid}).select()
        // console.log(ulist)
        return ulist.rowCount>0 ? true:false
    }

    async delete(userid,attentionid){
        await this.model().where({userid,attentionid}).delete()
    }

    async insert(data){
        await this.model().insert(data)
    }

}
module.exports=attention